package com.wanfajie.smsdistribute.db.repository

import com.wanfajie.smsdistribute.R
import com.wanfajie.smsdistribute.db.bean.sms.SmsBean

interface SmsRecordRepository {

    enum class Filter(val id: Int) {
        ALL(R.id.filter_all),
        FAILURE(R.id.filter_failure),
        SUCCESS(R.id.filter_success);

        companion object {

            fun valueOf(id: Int): Filter {
                return values().first { it.id == id }
            }
        }
    }

    fun resetSmsStatus(sms: SmsBean): Int
    fun remove(sms: SmsBean): Boolean
    fun query(filter: Filter, kw: String = ""): List<SmsBean>
    fun search(kw: String): List<SmsBean> = query(Filter.ALL, kw)
    fun queryAll(): List<SmsBean> = query(Filter.ALL)
    fun queryFailure(): List<SmsBean> = query(Filter.FAILURE)
    fun querySuccess(): List<SmsBean> = query(Filter.SUCCESS)
}
